package com.webex.ta.hydra.gui.table.celleditor;

import com.webex.ta.hydra.util.ConfirmDialog;

import javax.swing.*;
import java.awt.*;

/**
 * Created by Cisco WebEx.
 * User: vegaz
 * Date: 2010-10-26
 * Time: 10:26:33
 */
public class EditorDialog extends ConfirmDialog {
    public int response = JOptionPane.CLOSED_OPTION;
    public EditorDialog(Frame owner, String title) {
        super(owner, title, true);
    }

//    public static int showEditorDialog(Frame owner, String title,
//                                       AbstractEditorDialogComponent editor, String value) {
//        EditorDialog dialog = new EditorDialog(owner, title);
//        dialog.setContent(editor);
//        editor.setValue(value);
//        dialog.setVisible(true);
//        return dialog.response;
//    }

    @Override
    protected void onCancel() {
        response = JOptionPane.CANCEL_OPTION;
        super.onCancel();
    }

    @Override
    protected void onOk() {
        response = JOptionPane.YES_OPTION;
        super.onOk();
    }
}
